using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VQPPLAN
    {
        private bool _FTAUTOQC;
        public bool FTAUTOQC
        {
            get { return _FTAUTOQC; }
            set { _FTAUTOQC = value; OnPropertyChanged("FTAUTOQC", value); }
        }
        private string _QPLAN;
        public string QPLAN
        {
            get { return _QPLAN; }
            set { _QPLAN = value; OnPropertyChanged("QPLAN", value); }
        }
        public void NEWQP()
        {
            if (ARTST.Trim().Length == 0)
            {
                return;
            }
            TBMain.Clear();
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            LFD = VSDDAT.SD22.GETNEXT("0022", KRS, "QPPLAN");
            dwData["QPPARTST"] = ARTST;
            dwData["QPPPNRKRS"] = KRS;
            dwData["QPPPLFDNR"] = LFD;
            Insert(dwData);
        }
        public void Insert(DataRow _dwQP)
        {
            if (_dwQP == null)
                return;
            dwData["QPPNEUB"] = app.User;
            dwData["QPPNEUD"] = date;
            InsertQPPLAN(_dwQP, app.company);
            TBMain.Rows.InsertAt(_dwQP, 0);
        }
        public void SAVEQP(DataRow _dwQP)
        {
            if (_dwQP == null)
                return;
            dwData = TBMain.NewRow();
            dwData["QPPAENB"] = app.User;
            dwData["QPPAEND"] = date;
            UpdateQPPLAN(_dwQP, app.company, 0);
        }
    }
}
